package com.molyfun.parents.rest;

import android.content.Intent;
import android.os.Message;
import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.molyfun.parents.MFPApplication;
import com.molyfun.parents.activity.account.LoginActivity;
import com.molyfun.parents.activity.classroom.ClassRoomActivity;
import com.molyfun.parents.activity.coursecenter.model.SubjectListResponse;
import com.molyfun.parents.dao.entity.SingleChatDB;
import com.molyfun.parents.dao.gen.DaoMaster;
import com.molyfun.parents.dao.gen.DaoSession;
import com.molyfun.parents.dao.gen.SingleChatDBDao;
import com.molyfun.parents.rest.bean.*;
import com.molyfun.parents.uievent.EventDispatcherEnum;
import com.molyfun.parents.utils.ActivityManager;
import com.molyfun.parents.utils.Const;
import com.molyfun.parents.utils.PreferencesStorageUtil;
import com.molyfun.parents.utils.SecurityUtil;
import com.molyfun.parents.utils.StringUtils;
import com.molyfun.parents.utils.UIUtils;
import com.molyfun.parents.utils.security.BusinessException;
import com.molyfun.parents.zhibo.im.ZhiboAddImMsgRequest;
import com.molyfun.parents.zhibo.im.ZhiboStrMsgRequest;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;

import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

//import okhttp3.logging.HttpLoggingInterceptor;

//import okhttp3.logging.HttpLoggingInterceptor;

public class RestClient {

    public static final int DEFAULT_PAGE = 1;
    public static final int DEFAULT_PAGE_FIVE_SIZE = 5;
    public static final int DEFAULT_PAGE_SIZE = 10;
    public static final int ZHIBO_PLAYBACK_PAGE_SIZE = 30;
    public static final int LARGE_PAGE_SIZE = 100;
    public static final int TIME_OUT_DEFAULT = 20000; //默认超时时间
    private static String API_BASE_URL = "http://api.hellouser.molyfun.com/api/v1/";

    private static String SINA_SHORT_BASE_URL = "http://api.t.sina.com.cn/";

    public static String COMMON_GALLERY_BASE_URL = "http://192.168.3.30:8085/openclass/matter.html";

    static {
        refreshBaseUrl();
    }

    public static void refreshBaseUrl() {

        switch (PreferencesStorageUtil.getServerMode(MFPApplication.getInstance())) {
            case PreferencesStorageUtil.ServerMode.OFFICAL:
                API_BASE_URL = "http://api.hellouser.molyfun.com/api/v1/";
                ONLINE_OFFICE_FILE_URL_HEAD = "http://h5.hello.molyfun.com/file/look.html?url=";
                COMMON_GALLERY_BASE_URL = "http://h5.hello.molyfun.com/openclass/matter.html";
                break;
            case PreferencesStorageUtil.ServerMode.PREPARE:
                API_BASE_URL = "http://api.hellousertest.molyfun.com/api/v1/";
                //                API_BASE_URL= "http://192.168.3.78:8088/api/v1/";
                ONLINE_OFFICE_FILE_URL_HEAD = "http://h5.hellotest.molyfun.com/file/look.html?url=";
                COMMON_GALLERY_BASE_URL = "http://h5.hellotest.molyfun.com/openclass/matter.html";
                break;
            case PreferencesStorageUtil.ServerMode.TEST:
                API_BASE_URL = "http://192.168.3.242:8088/api/v1/";
//                API_BASE_URL = "http://192.168.3.215:8088/api/v1/";
                //                API_BASE_URL= "http://192.168.3.214:8088/api/v1/";
                ONLINE_OFFICE_FILE_URL_HEAD = "http://192.168.3.242:8088/file/look.html?url=";
//                ONLINE_OFFICE_FILE_URL_HEAD = "http://192.168.3.30:8085/file/look.html?url=";
                COMMON_GALLERY_BASE_URL = "http://h5.hellotest.molyfun.com/openclass/matter.html";
                break;
        }
    }



    public static String ONLINE_OFFICE_FILE_URL_HEAD = "http://192.168.3.30:8085/file/look.html?url=";

    private MFPService mfpService;
    private SinaShortService sinaShortService;

    public RestClient() {
        this(null, null);
    }

    public RestClient(String token, String user_agent) {
        HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
        logging.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
        httpClient.addInterceptor(logging);

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

        httpClient.addInterceptor(new MFPRequestInterceptor(token, user_agent));
//        httpClient.addInterceptor(interceptor);
        httpClient.connectTimeout(TIME_OUT_DEFAULT, TimeUnit.MILLISECONDS);
        httpClient.readTimeout(TIME_OUT_DEFAULT, TimeUnit.MILLISECONDS);
        Gson gson = new GsonBuilder().registerTypeAdapterFactory(new ItemTypeAdapterFactory()).create();
        Retrofit.Builder builder = new Retrofit.Builder().baseUrl(API_BASE_URL).addConverterFactory
                (GsonConverterFactory.create(gson));
        mfpService = builder.client(httpClient.build()).build().create(MFPService.class);
        sinaShortService = new Retrofit.Builder().baseUrl(SINA_SHORT_BASE_URL).addConverterFactory
                (GsonConverterFactory.create(gson)).client(httpClient.build()).build().create(SinaShortService.class);

    }

    class ItemTypeAdapterFactory implements TypeAdapterFactory {
        public <T> TypeAdapter<T> create(Gson gson, final TypeToken<T> type) {
            final TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
            final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
            return new TypeAdapter<T>() {
                public void write(JsonWriter out, T value) throws IOException {
                    delegate.write(out, value);
                }

                public T read(JsonReader in) throws IOException {
                    JsonElement jsonElement = elementAdapter.read(in);
                    if (jsonElement.isJsonObject()) {
                        JsonObject jsonObject = jsonElement.getAsJsonObject();
                        if (jsonObject.has("code") && jsonObject.get("code").isJsonPrimitive()) {
                            int code = 200;
                            try {
                                JsonElement codeElement = jsonObject.get("code").getAsJsonPrimitive();
                                code = codeElement.getAsInt();
                                System.out.println("restClient----->codeElement.getAsInt()" + codeElement.getAsInt());
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            System.out.println("restClient----->one" + code);
                            if (code != 200) {
                                System.out.println("restClient----->two" + code);
                                if (code == 1000) {
                                    PreferencesStorageUtil.logout(MFPApplication.getInstance());
                                    Intent intent = new Intent(MFPApplication.getInstance(), LoginActivity.class);
                                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                                    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                                    MFPApplication.getInstance().startActivity(intent);
                                    ActivityManager.getInstance().logout();
                                    UIUtils.showToast(MFPApplication.getInstance(), "账号过期，请重新登录");
                                } else if (code == 1010) {
//                                    UIUtils.showToast(MFPApplication.getInstance(), "账号已解绑，请重新选择机构");
////                                    OrganizationChooseDialogActivity.startActivity(MFPApplication.getInstance());
//                                    OrganizationActivity.startActivity(MFPApplication.getInstance());
                                } else if (code == 1080) {
                                    if(!TextUtils.isEmpty(ClassRoomActivity.mConversionId)){
                                        DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(MFPApplication.getInstance(), Const.DB_NAME, null);
                                        DaoMaster daoMaster = new DaoMaster(devOpenHelper.getWritableDatabase());
                                        DaoSession daoSession = daoMaster.newSession();
                                        SingleChatDBDao mSingleChatDBDao = daoSession.getSingleChatDBDao();
                                        SingleChatDB singleChatDB = mSingleChatDBDao.queryBuilder().where(SingleChatDBDao.Properties.Conversationid.eq(ClassRoomActivity.mConversionId)).build().unique();
                                        if (singleChatDB != null) {
                                            mSingleChatDBDao.delete(singleChatDB);
                                            //TODO 发消息
                                            Message message = new Message();
                                            message.what = EventDispatcherEnum.UI_EVENT_CONVERSION_DESTORY;
                                            MFPApplication.getInstance().getEventDispatcher().handleMessage(message);
                                        }
                                    }
                                } else if(code != 1020) {
                                    if (jsonObject.has("msg")) {
                                        JsonElement msgElement = jsonObject.get("msg").getAsJsonPrimitive();
                                        String msg = msgElement.getAsString();
                                        if(StringUtils.judgeContainsStr(msg)) {

                                        }else {
                                            UIUtils.showToast(MFPApplication.getInstance(), msg);
                                        }
                                    }
                                }
                            }

                        }
                    }
                    return delegate.fromJsonTree(jsonElement);
                }
            }.nullSafe();
        }
    }


    public Call<UserResponse> getUserInfo() {
        return mfpService.getUserInfo();
    }

    public Call<BaseResponse> checkPhoneAndInvitecode(String phone, String invitecode) {
        return mfpService.checkPhoneAndInvitecode(phone, invitecode);
    }

    public Call<UserResponse> login(String phone, String password) {
        return mfpService.login(phone, password);
    }

    public Call<RegThirdPartyResponse> wxlogin(String code, String nonce, String timestamp, String signature, String webtype) {
        return mfpService.wxlogin(code, nonce, timestamp, signature, webtype);
    }

    public Call<BaseResponse> logout() {
        return mfpService.logout();
    }

    public Call<UserResponse> register(String phone, String captchacode, String password, String username) {
        return mfpService.register(phone, captchacode, password, username);
    }

    public Call<StringResponse> checkOrganization(String code) {
        return mfpService.checkOrganization(code);
    }

    public Call<BaseResponse> bindOrganization(String code, String type, String name, String birthdatetime,
                                               String sex, String cardId) {
        return mfpService.bindOrganization(code, type, name, birthdatetime, sex, cardId);
    }

    public Call<UserResponse> registerWithEncrypt(String phone, String password, String username, String
            invitecode, String imgurl) {
        StringBuilder sb = new StringBuilder();
        sb.append("phone=" + phone);
        sb.append("&password=" + password);
        sb.append("&username=" + username);
        sb.append("&invitecode=" + invitecode);
        if (!TextUtils.isEmpty(imgurl)) {
            sb.append("&imgurl=" + imgurl);
        }
        String body = null;
        String sign = null;
        System.out.println("sb--->" + sb.toString());
        try {
            sign = SecurityUtil.signRSA(sb.toString(),
                    "miic47ibadanb7AG8A9gZMQbaqefaascaCaM77j3a7eaaEgbal4zFh4hnrmPQyl58kLq63hRaU9NwcZhQTKHK" +
                            "+yp98sYeqzXMQ2ypKLx2vSj7kWzRJuyFJpeHgOxQiHaMZvUHQ0yDbIocPCMLNHtzjhH4e58bemRqi7w2jC3hiNuVUyG7ZyHus8BFMUc2Y9D/uyOifVfGghmBTMGqsQL07dHA6Y2a7mbaaec7yabxmEHflR8o9zz1zLANLtyrOdsCd2g9OIyjsKnrNFiAOANo9qSvUYiiVWJ2AmB9qe5HAmTg1qkxEFLlywhbzgpTIG15MMdWoyENSRRXAjpkMWM4y+swNsphzQ6cu6ko2v25k7vq+lYDyllbas1XbQXgDdxCou3r4/LO7c4MBfM5qjbaouK5A4BLtrv3oUDGk+BnDX2KjRzrAY5vgzt+W+mKNfnp3D4hbn3oJHppeae6BA0hCgkSJSvdOwOBIV7mKIInYQcqqdmP0uOHf5X+TfxlE52wGJYF55bsiO2m37cGQ/hfH40bGE+/B2X2lGSznYjbDGURZayJ6n2+5RjR2GKMXXkHnGhaAeaR6sFbysKKw/wGqZLronjv+Zk0+mHzSK1qzDacO9DXYq2D8MfpphkFehWlETdyLynq+tYVqzC9lMmxa9BilyYnqjaxUAvy2tFhcrxEUVJXx3Djx3s63BeV1q3iXG2Zu6q44UhdCCauXFn7Ew4umRTYX+7lZ1Uv3bjaP3OVreA2Zc7aMjamQma65K2DBxyqqMBU0l6vQq7rCK8eXD5E9gEARuCiFLXLaCqvAExqJH8+F6a36+PiUq7zJ5SF4Ka7xwev33ega==");
        } catch (BusinessException e) {
            sign = sb.toString();

        }

        byte[] userData = sb.toString().getBytes();
        byte[] encodeData = null;
        String encodeStr = null;

        //        encodeStr = RSA.encryptWithStoredKey(sb.toString());

        System.out.println("body--->" + encodeStr);
        return mfpService.registerWithEncrypt(sign, toRequestBody(encodeStr));
    }


    public Call<UserResponse> updateInfo(String username, String imgurl) {
        return mfpService.updateInfo(username, imgurl);
    }

    public Call<BaseResponse> updatePassword(String oldpassword, String password) {
        return mfpService.updatePassword(oldpassword, password);
    }

    public Call<BaseResponse> recoverPassword(String phone, String password, String captchacode) {
        return mfpService.recoverPassword(phone, password, captchacode);
    }

    public Call<RegThirdPartyResponse> registerThirdAccound(String phone, String captchacode, String openid, String password, String type) {
        return mfpService.registerThirdAccound(phone, captchacode, openid, password, type);
    }

    public Call<BaseResponse> getSmsCode(String phone, String type) {
        return mfpService.getSmsCode(phone, type);
    }

    public Call<BaseResponse> checkPhone(String phone, String nonce, String timestamp, String signature) {
        return mfpService.checkPhone(phone, nonce, timestamp, signature);
    }

    public Call<GetAboutResponse> getAbout() {
        return mfpService.getAbout();
    }

    //    public Call<GetCommentsResponse> getComments(String topicid, int type, int pageNum, int pageSize) {
    //        return mfpService.getComments(topicid, type, pageNum, pageSize);
    //    }

    public Call<GetMediaCommentsResponse> getMediaComments(String topicid, int type, int pageNum, int
            pageSize) {
        return mfpService.getMediaComments(topicid, type, pageNum, pageSize);
    }

    /**
     * @param content
     * @param type     类型 1:回复 2:评论
     * @param topicid
     * @param targetid
     * @param mtype    //1 图片 2视频 3音频 4文字
     * @param cover
     * @param url
     * @param timelen
     * @return
     */
    public Call<SendCommentResponse> sendComment(String content, int type, String topicid, String targetid,
                                                 int mtype, String cover, String url, int timelen) {
        return mfpService.sendComment(content, type, topicid, targetid, mtype, cover, url, timelen);
    }

    public Call<SendCommentResponse> sendHomelandComment(String content, String articleid, String targetid,
                                                         int mtype, String cover, String url, int timelen) {
        return mfpService.sendHomelandComment(content, articleid, targetid, mtype, cover, url, timelen);
    }

    public Call<LikeResponse> likeTopic(String topicid) {
        return mfpService.likeTopic(topicid);
    }

    public Call<BaseResponse> cancelLikeTopic(String likeid) {
        return mfpService.cancelLikeTopic(likeid);
    }

    public Call<LikeResponse> likeHomeLand(String homelandid) {
        return mfpService.likeHomeLand(homelandid);
    }

    public Call<BaseResponse> cancelLikeHomeLand(String likeid) {
        return mfpService.cancelLikeHomeLand(likeid);
    }

    public Call<BaseResponse> delTopic(String topicId) {
        return mfpService.delTopic(topicId);
    }

    public Call<BaseResponse> addTopicSuggestion(String content, String topicid) {
        return mfpService.addTopicSuggestion(content, topicid);
    }

    public Call<BaseResponse> addHomelandSuggestion(String content, String articleid) {
        return mfpService.addHomelandSuggestion(content, articleid);
    }

    /**
     * topicSel
     *
     * @param topicid
     * @return
     */
    public Call<BaseResponse> delComment(String topicid) {
        return mfpService.delComment(topicid);
    }

    /**
     * 服务器确定使用最多数目加载
     *
     * @return
     */
    public Call<TagListResponse> getTagList() {
        return mfpService.getTagList(DEFAULT_PAGE, LARGE_PAGE_SIZE);
    }

    public Call<HomeWorkResponse> getTaskList(String plandatetime) {
        return mfpService.getTaskList(plandatetime, DEFAULT_PAGE, LARGE_PAGE_SIZE);
    }

    public Call<RecordResponse> getRecordList(int pageNum, int pageSize, String pagetimestamp, String
            around) {
        return mfpService.getRecordList(pageNum, pageSize, pagetimestamp, around);
    }

    public Call<SendRecordResponse> postRecord(String content, int type, String url, String cover, int
            timelen) {
        return mfpService.postRecord(content, type, url, cover, timelen);
    }

    public Call<BaseResponse> deleteRecord(String impressionid) {
        return mfpService.deleteRecord(impressionid);
    }

    public Call<CourseListResponse> getCourseList(String plandatetime, int pageNum, int pageSize) {
        return mfpService.getCourseList(plandatetime, pageNum, pageSize);
    }

    public Call<CourseListResponse> getClassRoomCourseList(String groupid, String plandatetime, int pageNum){
        return mfpService.getClassRoomCourseList(groupid, plandatetime, pageNum);
    }

    public Call<CourseFeedbackListResponse> getCourseFeedbackList(String courseId) {
        return mfpService.getCourseFeedbackList(courseId, DEFAULT_PAGE, LARGE_PAGE_SIZE);
    }

    public Call<BaseResponse> delCourseDownload(String relid) {
        return mfpService.delCourseDownload(relid);
    }

    public Call<MsgListResponse> getMsgList(int pageNum, int pageSize) {
        return mfpService.getMsgList(pageNum, pageSize);
    }

    public Call<BaseResponse> readMsg(String messageid) {
        return mfpService.readMsg(messageid);
    }

    /**
     * @param courseId   课程id
     * @param isdownload 是否是下载任务 y:是 n:否
     * @return
     */
    public Call<CourseDetailResponse> getCourseDetail(String courseId, String isdownload) {
        return mfpService.getCourseDetail(courseId, isdownload);
    }

    public Call<CourseListResponse> getDownLoadList(int pageNum, int pageSize) {
        return mfpService.getDownLoadList(pageNum, pageSize);
    }

    public Call<BaseResponse> sendSuggestion(String content) {
        return mfpService.sendSuggestion(content);
    }

    public Call<CheckVersionResponse> checkVersion(String versionnum) {
        return mfpService.checkVersion(versionnum);
    }

    public Call<BaseResponse> addCourseFeedBack(AddCourseFeedBackRequest addCourseFeedBackRequest) {
        return mfpService.addCourseFeedBack(addCourseFeedBackRequest);
    }

    public Call<BaseResponse> updateCourseFeedback(@Body CourseFeedbackEditRequest
                                                           courseFeedbackEditRequest) {
        return mfpService.updateCourseFeedback(courseFeedbackEditRequest);
    }

    public Call<GetSummaryResponse> getSummary(String plandatetimestr) {
        return mfpService.getSummary(plandatetimestr);
    }

    public Call<BaseResponse> commitHomeWork(CommitHomeWorkRequest commitHomeWorkRequest) {
        return mfpService.commitHomeWork(commitHomeWorkRequest);
    }

    public static RequestBody toRequestBody(String value) {
        return RequestBody.create(MediaType.parse("text/plain"), value);
    }

    public Call<ReportBriefListResponse> getReportList(int pageNum, int pageSize) {
        return mfpService.getReportList(pageNum, pageSize);
    }

    public Call<ReportDetailResponse> getReportDetail(String id) {
        return mfpService.getReportDetail(id);
    }

    //最多五条反馈
    public Call<ReportFeedbackListResponse> getReportFeedbackList(String reportid) {
        return mfpService.getReportFeedbackList(reportid, DEFAULT_PAGE, DEFAULT_PAGE_SIZE);
    }

    public Call<BaseResponse> addReport(String reportid, String content) {
        return mfpService.addReport(reportid, content);
    }

    public Call<BaseResponse> updateReportReport(String reportid, String content) {
        return mfpService.updateReport(reportid, content);
    }

    public Call<NoticeDetailResponse> getNoticeDetail(String id) {
        return mfpService.getNoticeDetail(id);
    }

    public Call<DateHasDataResponse> getCourseDateHasDataList(String datestr) {
        return mfpService.getCourseDateHasDataList(datestr);
    }

    public Call<DateHasDataResponse> getTeamDateHasDataList(String datestr, String groupid){
        return mfpService.getTeamDateHasDataList(datestr, groupid);
    }

    /**
     * 2017-02-23
     */

    public Call<ReportResultResponse> getEvaluateList(int pageNum, int pageSize) {
        return mfpService.getEvaluateList(pageNum, pageSize);
    }

    public Call<GetReportResultResponse> getEvaluateanalysisResult(String evaluateid) {
        return mfpService.getEvaluateanalysisResult(evaluateid);
    }

    public Call<GetIepPlanTableResponse> getEvaluatePlanList(String evaluateid) {
        return mfpService.getEvaluatePlanList(evaluateid);
    }

    public Call<IepTempListResponse> getIepTempList(String ieptempid, int pageNum) {
        return mfpService.getIepTempList(ieptempid, pageNum, 3);
    }

    public Call<PlanDetailCallListViewResponse> getPlanDetailCallList(String tempid, String trainingid, int pageNum, int pageSize) {
        return mfpService.getPlanDetailCallList(tempid, trainingid, pageNum, pageSize);
    }

    public Call<TrainingListResponse> getTrainingList(int pageNum, int pageSize) {
        return mfpService.getTrainingList(pageNum, pageSize);
    }

    public  Call<TrainingListResponse> getClassRoomTrainingList(String groupid, int pageNum){
        return mfpService.getClassRoomTrainingList(groupid, pageNum);
    }

    public Call<PlanDetailResponse> getTrainingInfo(String id) {
        return mfpService.getTrainingInfo(id);
    }

    public Call<ReportPlanFeedbackListResponse> getTrainingFeedbackList(String trainingid, int pageNum, int
            pageSize) {
        return mfpService.getTrainingFeedbackList(trainingid, pageNum, pageSize);
    }

    public Call<UserProductListResponse> getUserProductList(String status, int pageNum, int pageSize) {
        return mfpService.getUserProductList(status, pageNum, pageSize);
    }

    public Call<ProductDetailResponse> getProductDetail(String id) {
        return mfpService.getProductDetail(id);
    }

    /**
     * @param type       大分类 综合:comsive 学习:learn
     * @param chartstype 小分类 日:day 周:week 月:month
     * @return
     */
    public Call<RankingListResponse> getRanking(int pageNum, String type, String chartstype) {
        return mfpService.getRanking(pageNum, DEFAULT_PAGE_SIZE, type, chartstype);
    }

    public Call<GatherScoreTaskListResponse> getGatherScoreList(int pageNum, int pageSize, String
            missiontypeid) {
        return mfpService.getGatherScoreList(pageNum, pageSize, missiontypeid);
    }

    public Call<TypeTabListResponse> getTypeList() {
        return mfpService.getTypeList(DEFAULT_PAGE, LARGE_PAGE_SIZE);
    }

    public Call<ProductListResponse> getProductList(String typeid, int pageNum, int pageSize) {
        return mfpService.getProductList(typeid, pageNum, pageSize);
    }

    public Call<GetProductTypeResponse> getProductType() {
        return mfpService.getProductTypeList();
    }

    public Call<OrderDetailResponse> createOrder( String subjectid) {
        return mfpService.createOrder(subjectid);
    }

    public Call<BaseResponse> cancelOrder(String id) {
        return mfpService.cancelOrder(id);
    }

    public Call<BaseResponse> delOrder(String id) {
        return mfpService.delOrder(id);
    }

    public Call<GetPayInfoResponse> getPayOrderInfo(String id, String type) {
        return mfpService.getPayOrderInfo(id, type);
    }

    public Call<GetWxPayInfoResponse> getWxPayOrderInfo(String id) {
        return mfpService.getWxPayOrderInfo(id, "wxpay");
    }

    public Call<TopicDetailResponse> getHomelandDetail(String articleid) {
        return mfpService.getHomelandDetail(articleid, RestClient.DEFAULT_PAGE, RestClient.DEFAULT_PAGE_SIZE);
    }

    public Call<TeacherDetailResponse> getOrgTeacherInfo(String id) {
        return mfpService.getOrgTeacherInfo(id);
    }

    public Call<OrganizationListResponse> getOrganizationList(String status, int pageNum, int pageSize) {
        return mfpService.getOrganizationList(status, pageNum, pageSize);
    }

    public Call<GetMyPageResponse> getStudentInfo() {
        return mfpService.getStudentInfo();
    }


    /**
     * @param status   状态 全部:传空 待付款:init 已付款:pass
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Call<GetOrderListResponse> getOrderList(String status, int pageNum, int pageSize) {
        return mfpService.getOrderList(status, pageNum, pageSize);
    }

    /**
     * @param status   状态 待确认:init 已消费:pass
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Call<ExpenseRecordListResponse> getConsumeRecordList(String status, int pageNum, int pageSize) {
        return mfpService.getConsumeRecordList(status, pageNum, pageSize);
    }

    /**
     * 消费单个内容
     *
     * @param id
     * @return
     */
    public Call<BaseResponse> orderProductConsume(String id) {
        return mfpService.orderProductConsume(id);
    }

    public Call<ExpenseRecordCountResponse> orderProductConsumeRecordNum() {
        return mfpService.orderProductConsumeRecordNum();
    }

    public Call<BaseResponse> changeOrganization(String departid, String studentid) {
        return mfpService.changeOrganization(departid, studentid);
    }

    public Call<UserResponse> updateStudentInfo(UpdateStudentInfoRequest updateStudentInfoRequest) {
        return mfpService.updateStudentInfo(updateStudentInfoRequest);
    }

    public Call<BaseResponse> dailySign() {
        return mfpService.dailySign();
    }

    /**
     * @return
     */
    public Call<MainActivityListResponse> getActivityList() {
        return mfpService.getActivityList("pop", DEFAULT_PAGE, DEFAULT_PAGE_SIZE);
    }

    public Call<GetEvaluateAnalysisListResponse> getEvaluateAnalysisList(String id) {
        return mfpService.getEvaluateAnalysislist(id);
    }

    public Call<BaseResponse> delHomelandComment(String articleid) {
        return mfpService.delHomelandComment(articleid);
    }

    /**
     * @param filetype 分类 诊断文件:dians 问题描述文件:sdesc
     * @param type     类型 1:图片 2:视频 3:音频 5:文件
     * @param cover    视频封面
     * @param url      链接
     * @param name     name
     * @return
     */
    public Call<MediaobjectBeanResponse> uploadStudentFile(String filetype, String type, String cover,
                                                           String url, String name) {
        return mfpService.uploadStudentFile(filetype, type, cover,
                url, name);
    }

    public Call<CustomPlanlistResponse> getPlanList(int pageNum, int pageSize) {
        return mfpService.getPlanList(pageNum, pageSize);
    }

    public Call<CustomPlanDocListResponse> getCustomPlanDocList(String customplanid) {
        return mfpService.getCustomPlanDocList(customplanid, DEFAULT_PAGE, DEFAULT_PAGE_SIZE);
    }

    public Call<CustomMsglistResponse> getCustomplanMsgList(String customplanid, String type, int pageNum, int pageSize) {
        return mfpService.getCustomplanMsgList(customplanid, type, "", pageNum, pageSize);
    }

    public Call<CustomMsglistResponse> getCustomplanMsgList(String customplanid, String type, String msgid, int pageNum, int pageSize) {
        return mfpService.getCustomplanMsgList(customplanid, type, msgid, pageNum, pageSize);
    }

    /**
     * @param degree 满意度 1:满意 2:一般 3:不满意
     */
    public Call<BaseResponse> postCustomplanEval(String customplanid, String degree, String commentid) {
        return mfpService.postCustomplanEval(customplanid, degree, commentid);
    }

    /**
     * 咨询定制接口
     *
     * @return
     */
    public Call<CreateCustomPlanResponse> createCustomplan() {
        return mfpService.createCustomplan();
    }

    public Call<BaseResponse> postDocUpdate(CustomPlanFileUploadRequest courseFeedbackEditRequest) {
        return mfpService.postDocUpdate(courseFeedbackEditRequest);
    }

    /**
     * @param content      内容
     * @param customplanid 咨询计划id
     * @param type         类型 1:图片 2:视频 3:音频 4:文字 5:套餐 6:评价
     * @param cover        视频封面
     * @param url          链接 套餐消息:套餐url
     * @param timelen      时长
     *                     //     * @param extendfield1 扩展字段1 套餐消息:套餐id 评价消息:-1:未操作 1:满意 2:一般 3:不满意
     *                     //     * @param extendfield2 扩展字段2 套餐消息:套餐标题
     *                     //     * @param extendfield3 扩展字段3 套餐消息:套餐原价
     *                     //     * @param extendfield4 扩展字段4 套餐消息:套餐折扣价
     *                     //     * @param extendfield5 扩展字段5 套餐消息:售出数量
     *                     //     * @param extendfield6 扩展字段6 套餐消息:库存
     * @return
     */
    public Call<BaseResponse> addMsg(String content, String customplanid,
                                     String type, String cover, String url,
                                     String timelen) {
        return mfpService.addMsg(content, customplanid, type, cover, url, timelen);
    }

    /**
     * @param filetype 分类 诊断文件:dians 问题描述文件:sdesc
     * @param id
     * @return
     */
    public Call<BaseResponse> delStudentFile(String filetype, String id) {
        return mfpService.delStudentFile(filetype, id);
    }

    public Call<StringResponse> getDocNum(String customplanid) {
        return mfpService.getDocNum(customplanid);
    }

    public Call<BaseResponse> batDelMsg(MsgDeleteBatRequest msgDeleteBatRequest) {
        return mfpService.batDelMsg(msgDeleteBatRequest);
    }

    /**
     * 报名
     */
    public Call<SignUpListResponse> signUpList(String pageNum, String pageSize) {
        return mfpService.getSignList(pageNum, pageSize);
    }

    /**
     * type 类型enroll：报名 continue:继续报名
     * @param departcode
     * @return
     */
    public Call<SignUpNoticeResponse> signUpNotice(String departcode, String type) {
        return mfpService.getSignNotice(departcode, type, "web");
    }

    public Call<SignUpEvaluateResponse> signUpEvaluate(String pageNum, String pageSize, String departid) {
        return mfpService.getSignEvaluate(pageNum, pageSize, departid);
    }

    public Call<SignUpSubmitInfoResponse> signUpSubmitInfo(String departid, SignUpSubmitInfoRequest signUpSubmitInfoRequest) {
        return mfpService.signUpSubmitInfo(departid, signUpSubmitInfoRequest);
    }

    public Call<SignUpDetailResponse> signUpDetailInfo(String enrollstudnetid) {
        return mfpService.signUpDetailInfo(enrollstudnetid);
    }

    public Call<SignUpDetailEvaluateBean> signUpDetailEvaluate(String pageNum, String pageSize, String departid, String enrollstudnetid) {
        return mfpService.signUpDetailEvaluate(pageNum, pageSize, departid, enrollstudnetid);
    }


    public Call<GiveUpInformResponse> signUpisGiveUp(String enrollstudnetid) {
        return mfpService.signUpIsGiveUpInform(enrollstudnetid);
    }

    public Call<SignUpInformResponse> signUpInform(String enrollstudnetid) {
        return mfpService.signUpInform(enrollstudnetid);
    }

    public Call<BaseResponse> signUpGiveupReason(String enrollstudnetid) {
        return mfpService.signUpGiveupReason(enrollstudnetid);
    }

    public Call<BaseResponse> signUpFixStudentInfo(SignUpFixStudentInfoBean upFixStudentInfoBean) {
        return mfpService.signUpFixStudentInfo(upFixStudentInfoBean);
    }

    public Call<BaseResponse> signUpFixparentInfo(SignUpFixParentInfoBean upFixStudentInfoBean) {
        return mfpService.signUpFixparentInfo(upFixStudentInfoBean);
    }

    /**
     * 更换账户
     */

    public Call<BaseResponse> getCaptche(String phone) {
        return mfpService.getCaptche(phone);
    }

    public Call<BaseResponse> submitCaptcheInfo(String phone, String captcheCode) {
        return mfpService.submitCaptcheInfo(phone, captcheCode);
    }

    public Call<BaseResponse> signUpEmail(String email) {
        return mfpService.signUpEmail(email);
    }

    public Call<BaseResponse> newPassword(String oldpassword, String password) {
        return mfpService.newPassword(oldpassword, password);
    }

    public Call<ThirdUnboundResponse> unboundThird(String openid) {
        return mfpService.unboundThird(openid);
    }

    /**
     * 报告统计
     */
    public Call<ReportFromsTypeResponse> getReportType(String reportId) {
        return mfpService.getReportType(reportId);
    }

    public Call<RepoetFromsLineListResponse> getReportLineDate(String reportId) {
        return mfpService.getReportLineData(reportId);
    }

    public Call<ReportFromsLineCourseResponse> getReportLineCourse(String reportId, String courseid) {
        return mfpService.getReportLineCourse(reportId, courseid);
    }

    public Call<SchoolliveAllResponse> getSchoolLive(String plandatetimestr){
        return mfpService.getSchoolLive(plandatetimestr);
    }

    public Call<SubjectListResponse> getSubjectList(int pageNum, int pageSize, String pricemax, String pricemin,
                                                    String commentnum, String sellcount, String datetimestr, String best, String key){
        return mfpService.getSubjectList(pageNum, pageSize, pricemax, pricemin, commentnum, sellcount, datetimestr, best, key);
    }

    public Call<SubjectListResponse> getMySubjectList(int pageNum, int pageSize){
        return mfpService.getMySubjectList(pageNum, pageSize);
    }

    public Call<ProductDetailInfoResponse> getProductDetailInfo(String id){
        return mfpService.getProductDetailInfo(id);
    }

    public Call<ProductatalogListResponse> getProductCatalogList(String id){
        return mfpService.getProductCatalogList(id);
    }

    public Call<ProductCommentListResponse> getProductCommentList(String id, int pageNum, int pageSize){
        return mfpService.getProductCommentList(id, pageNum, pageSize);
    }

    public Call<BaseResponse> addSubjectComment(String id, SubjectCommentRequestBody subjectCommentRequestBody){
        return mfpService.addSubjectComment(id, subjectCommentRequestBody);
    }

    public Call<GetSubjectResponse> getSubjectCatalogInfo(String subjectcourseid){
        return mfpService.getSubjectCatalogInfo(subjectcourseid);
    }

    public Call<BaseResponse> getUploadToken(){
        return mfpService.getUploadToken();
    }

    public Call<BaseResponse> getUploadTokenByPath(String filepath){
        return mfpService.getUploadTokenByPath(filepath);
    }

    public Call<StringResponse> updateMediaUrl(UploadUrlRequest uploadUrlRequest){
        return mfpService.upGradeMediaUrl(uploadUrlRequest);
    }

    public Call<ThirdBeanResponse> bindThirdParty(String code){
        return mfpService.bindThirdParty(code, "2");
    }

    public Call<BaseResponse> sendRtcApply(String id){
        return mfpService.sendRtcApply(id);
    }

    public Call<BaseResponse> sendZhiboEvent(@Body ZhiboAddImMsgRequest resuest){
        return mfpService.sendZhiboEvent(resuest);
    }

    public Call<ZhiboRoomResponse> enterZhiboRoom(String id){
        return mfpService.enterZhiboRoom(id);
    }

    public Call<BaseResponse> leaveZhiboRoom(String liveid){
        return mfpService.leaveZhiboRoom(liveid);
    }

    public Call<BaseResponse> sendRtcApplyCancel(String id){
        return mfpService.sendRtcApplyCancel(id);
    }

    public Call<BaseResponse> sendMsg(ZhiboStrMsgRequest resuest){
        return mfpService.sendMsg(resuest);
    }

    public Call<BaseResponse> sendMeetingInviteConfirm(String id, String invitekey){
        return mfpService.sendMeetingInviteConfirm(id, invitekey);
    }

    public Call<BaseResponse> sendMeetingInviteCancel(String id, String invitekey){
        return mfpService.sendMeetingInviteCancel(id, invitekey);
    }

    public Call<BaseResponse> stopConference(String id, String channel){
        return mfpService.stopConference(id, channel);
    }

    /**
     * 直播消息和事件接口
     * @param id
     * @return
     */
    public Call<ZhiboRecordResponse> getRecordEventList(String id, String timelenstamp){
        return mfpService.getRecordEventList(id, timelenstamp);
    }

    public Call<TeamListResponse> getClassGoodList(int pageNum){
        return mfpService.getClassGoodList(pageNum);
    }

    /**
     * 新版班级里面加上了小组数据
     * @param pageNum
     * @return
     * @since 2018-06-17
     */
    public Call<TeamListResponse> getTeamList(int pageNum){
        return mfpService.getTeamList(pageNum, "class");
    }

    public Call<TeamUserlistResponse> getTeamMemberList(String groupid, int pageNum){
        return mfpService.getTeamMemberList(groupid, pageNum);
    }

    public Call<AnnouncementListResponse> getTeamNoticeList(String groupid, int pageNum){
        return mfpService.getTeamNoticeList(groupid, pageNum);
    }

    public Call<List<SinaShortUrlBean>> getShortUrl(String urlLong){
        return sinaShortService.getShortUrl("1609946433", urlLong);
    }

    public Call<ChatMessageResponse> addImMsg(AddImMsgRequest addImMsgRequest){
        return mfpService.addImMsg(addImMsgRequest);
    }

    public Call<CustomMsglistResponse> getCommonMsgList(String conversationid, String msgId, String pageNum){
        return mfpService.getCommonMsgList(conversationid, msgId, pageNum);
    }

    public Call<StringResponse> createSingleConversation(CreateSingleConversionRequest createSingleConversionRequest){
        return mfpService.createSingleConversation(createSingleConversionRequest);
    }

    public Call<GetSingleLiveVideoRecordListResponse> getLiveRecordList(String groupid, int pageNum){
        return mfpService.getLiveRecordList(groupid, pageNum);
    }

    public Call<CourseListResponse> getUserCourseList(String plandatetimestr, int pageNum){
        return mfpService.getUserCourseList(plandatetimestr, pageNum);
    }

    public Call<ZhiboRoomResponse> enterTeamZhiboRoom(String groupid){
        return mfpService.enterTeamZhiboRoom(groupid);
    }

    public Call<NewTeamEvaluateTrainingListResponse> getClassTeamEvaluateTrainingList(String groupid){
        return mfpService.getClassTeamEvaluateTrainingList(groupid);
    }

    public Call<NewTeamSheetListResponse> getClassTeamEvaluateList(String groupid){
        return mfpService.getClassTeamEvaluateList(groupid);
    }

    public Call<SignUpSubmitInfoResponse> newTeamSheetSubmitInfo(NewSignUpSubmitInfoRequest newSignUpSubmitInfoRequest){
        return mfpService.newTeamSheetSubmitInfo(newSignUpSubmitInfoRequest);
    }

    public Call<OrderDetailResponse> createTeamOrder(String groupid){
        return mfpService.createTeamOrder(groupid);
    }

    public Call<BaseResponse> refundOrder(RefundOrderRequest refundOrderRequest){
        return mfpService.refundOrder(refundOrderRequest);
    }

    public Call<GetRefundInfoResponse> getRefundInfo(String id){
        return mfpService.getRefundInfo(id);
    }

    public Call<BaseResponse> getGroupStatus(String conversationid){
        return mfpService.getGroupStatus(conversationid);
    }

    interface SinaShortService {
        @GET("short_url/shorten.json")
        Call<List<SinaShortUrlBean>> getShortUrl(@Query("source") String source, @Query("url_long") String url_long);
    }

    interface MFPService {

        //检查手机号邀请码
        @FormUrlEncoded
        @POST("user/checkPhoneAndInvitecode")
        Call<BaseResponse> checkPhoneAndInvitecode(@Field("phone") String phone, @Field("invitecode")
                String invitecode);

        @GET("user/info")
        Call<UserResponse> getUserInfo();

        /**
         * @param phone
         * @param type  类型:reg 注册 recoverpass 找回密码 默认为 reg
         * @return
         */
        @GET("user/captcha/{phone}")
        Call<BaseResponse> getSmsCode(@Path("phone") String phone, @Query("type") String type);

        @FormUrlEncoded
        @POST("user/checkPhoneThirdparty")
//POST /api/v1/user/checkPhoneThirdparty
        Call<BaseResponse> checkPhone(@Field("phone") String phone, @Field("nonce") String nonce, @Field("timestamp") String timestamp, @Field("signature") String signature);

        @FormUrlEncoded
        @POST("user/login")
        Call<UserResponse> login(@Field("phone") String phone, @Field("password") String password);

        @FormUrlEncoded
        @POST("user/loginthirdparty")
        Call<RegThirdPartyResponse> wxlogin(@Field("code") String code, @Field("nonce") String nonce, @Field("timestamp") String timestamp, @Field("signature") String signature, @Field("webtype") String webtype);

        @POST("user/about")
        Call<GetAboutResponse> getAbout();

        @FormUrlEncoded
        @POST("user/checkOrgCode")
        Call<StringResponse> checkOrganization(@Field("code") String code);

        /**
         * @param code
         * @param type 机构代码:org 学生邀请码:stdnt 默认为 stdnt
         * @param sex  性别 0:男 1:女
         * @return
         */
        @FormUrlEncoded
        @POST("user/bindOrgOrStudentCode")
        Call<BaseResponse> bindOrganization(@Field("code") String code, @Field("type") String type, @Field
                ("name") String name, @Field("birthdatetime") String birthdatetime, @Field("sex") String
                                                    sex, @Field("cardid") String cardId);

        @GET("user/logout")
        Call<BaseResponse> logout();

        @FormUrlEncoded
        @POST("user/regSimple")
        Call<UserResponse> register(@Field("phone") String phone, @Field("captchacode") String captchacode,
                                    @Field("password") String password, @Field("username") String username);

        @POST("user/regWithComplexEncrypt")
        Call<UserResponse> registerWithEncrypt(@Header("sign") String sign, @Body RequestBody modelMap);

        @FormUrlEncoded
        @POST("user/updateInfo")
        Call<UserResponse> updateInfo(@Field("username") String username, @Field("imgurl") String imgurl);

        @FormUrlEncoded
        @POST("user/updatePassword")
        Call<BaseResponse> updatePassword(@Field("oldpassword") String oldpassword, @Field("password")
                String password);

        @FormUrlEncoded
        @POST("user/recoverPasswordWithCode")
        Call<BaseResponse> recoverPassword(@Field("phone") String phone, @Field("password") String
                password, @Field("captchacode") String captchacode);

        @FormUrlEncoded
        @POST("user/regThirdparty")
        Call<RegThirdPartyResponse> registerThirdAccound(@Field("phone") String phone, @Field("captchacode") String captchacode, @Field("openid") String
                openid, @Field("password") String password, @Field("type") String type);

        /**
         * @param pageNum
         * @param pageSize
         * @param title       查询字符串
         * @param publiclevel 公开级别 0:个人话题 1:公开话题
         * @return
         */
        @GET("topic/topicList")
        Call<TopicBriefResponse> getTopic(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize,
                                          @Query("title") String title, @Query("publiclevel") int
                                                  publiclevel);

        @GET("user/studentInfo")
        Call<GetMyPageResponse> getStudentInfo();


        /**
         * @param pageNum
         * @param pageSize
         * @param type       大分类 综合:comsive 学习:learn
         * @param chartstype 小分类 日:day 周:week 月:month
         * @return
         */
        @GET("charts/list")
        Call<RankingListResponse> getRanking(@Query("pageNum") int pageNum, @Query("pageSize") int
                pageSize, @Query("type") String type, @Query("chartstype") String chartstype);


        @POST("mission/dailySign")
        Call<BaseResponse> dailySign();

        /**
         * 获取任务类型列表
         *
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("mission/typeList")
        Call<TypeTabListResponse> getTypeList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("mission/list")
        Call<GatherScoreTaskListResponse> getGatherScoreList(@Query("pageNum") int pageNum, @Query
                ("pageSize") int pageSize, @Query("missiontypeid") String missiontypeid);

        /**
         * @param topicid
         * @param ishot    y:热门详情 n:个人详情 默认为n
         * @param pageNum
         * @param pageSize
         * @return
         */
        //        @GET("topic/info/{topicid}")
        //        Call<TopicDetailResponse> getTopicDetail(@Path("topicid") String topicid, @Query("ishot")
        // String ishot, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
        @GET("topic/infoWithFullMedia/{topicid}")
        Call<TopicDetailResponse> getTopicDetail(@Path("topicid") String topicid, @Query("ishot") String
                ishot, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("home/info/{articleid}")
        Call<TopicDetailResponse> getHomelandDetail(@Path("articleid") String articleid, @Query("pageNum")
                int pageNum, @Query("pageSize") int pageSize);

        /**
         * @param topicid
         * @param type     类型 1:回复 2:评论
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("topic/commentList/{topicid}")
        Call<GetCommentsResponse> getComments(@Path("topicid") String topicid, @Query("type") int type,
                                              @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("topic/commentListWithFullMedia/{topicid}")
        Call<GetMediaCommentsResponse> getMediaComments(@Path("topicid") String topicid, @Query("type") int
                type, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        /**
         * type1 回复别人的评论 需要评论id type2 回复话题 需要话题id
         *
         * @param content  内容
         * @param type     类型 1:回复 2:评论
         * @param topicid  话题id
         * @param targetid 要回复的评论目标id
         * @param mtype    类型 1:图片 2:视频 3:音频 4:文字
         * @param cover    视频封面
         * @param url      链接
         * @return
         */
        @FormUrlEncoded
        @POST("topic/commentAdd")
        Call<SendCommentResponse> sendComment(@Field("content") String content, @Field("type") int type,
                                              @Field("topicid") String topicid, @Field("targetid") String
                                                      targetid, @Field("mtype") int mtype, @Field("cover")
                                                      String cover, @Field("url") String url, @Field
                                                      ("timelen") int timelen);

        @FormUrlEncoded
        @POST("home/commentAdd")
        Call<SendCommentResponse> sendHomelandComment(@Field("content") String content, @Field("articleid")
                String articleid, @Field("targetid") String targetid, @Field("mtype") int mtype, @Field
                                                              ("cover") String cover, @Field("url") String url, @Field("timelen") int timelen);

        @GET("topic/like/{topicid}")
        Call<LikeResponse> likeTopic(@Path("topicid") String topicid);

        @GET("topic/likeCancel/{likeid}")
        Call<BaseResponse> cancelLikeTopic(@Path("likeid") String likeid);

        @GET("home/like/{articleid}")
        Call<LikeResponse> likeHomeLand(@Path("articleid") String articleid);

        @GET("home/likeCancel/{likeid}")
        Call<BaseResponse> cancelLikeHomeLand(@Path("likeid") String likeid);

        /**
         * 获取标签列表
         *
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("topic/attrList")
        Call<TagListResponse> getTagList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @POST("topic/add")
        Call<BaseResponse> postTopic(@Body NewTopicRequest newTopicRequest);

        @GET("topic/delete/{topicid}")
        Call<BaseResponse> delTopic(@Path("topicid") String topicid);

        //        @GET("topic/commentDel/{commentid}")
        @GET("topic/commentRelCancel/{topicid}")
        Call<BaseResponse> delComment(@Path("topicid") String topicid);

        /**
         * 删除家园记录
         *
         * @param articleid
         * @return
         */
        @GET("home/delete/{articleid}")
        Call<BaseResponse> delHomeland(@Path("articleid") String articleid);

        @GET("home/commentRelCancel/{articleid}")
        Call<BaseResponse> delHomelandComment(@Path("articleid") String articleid);

        /**
         * @param content 内容
         * @param topicid 话题id
         * @return
         */
        @FormUrlEncoded
        @POST("topic/topicSuggestionAdd")
        Call<BaseResponse> addTopicSuggestion(@Field("content") String content, @Field("topicid") String
                topicid);


        /**
         * 家庭作业
         */
        @GET("task/list")
        Call<HomeWorkResponse> getTaskList(@Query("plandatetimestr") String plandatetime, @Query("pageNum")
                int pageNum, @Query("pageSize") int pageSize);

        /**
         * 记录
         *
         * @param pageNum
         * @param pageSize
         * @param pagetimestamp 时间戳
         * @param around        时间戳前数据(毫秒值):before else aftter(default)
         * @return
         */
        @GET("impression/list")
        Call<RecordResponse> getRecordList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize,
                                           @Query("pagetimestamp") String pagetimestamp, @Query("around")
                                                   String around);

        @FormUrlEncoded
        @POST("impression/add")
        Call<SendRecordResponse> postRecord(@Field("content") String content, @Field("type") int type,
                                            @Field("url") String url, @Field("cover") String cover, @Field
                                                    ("timelen") int timelen);

        @GET("impression/delete/{impressionid}")
        Call<BaseResponse> deleteRecord(@Path("impressionid") String impressionid);

        /**
         * @param plandatetime 查询时间
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("course/list")
        Call<CourseListResponse> getCourseList(@Query("plandatetimestr") String plandatetime, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);


        @GET("group/courselist/{groupid}")
        Call<CourseListResponse> getClassRoomCourseList(@Path("groupid") String groupid, @Query("plandatetimestr") String plandatetime, @Query
                ("pageNum") int pageNum);

        /**
         * @param pageNum
         * @return
         * @since 2018-06-17
         */
        @GET("group/classlist")
        Call<TeamListResponse> getClassGoodList(@Query("pageNum") int pageNum);

        /**
         * @param groupid 群组id
         * @since 2018-06-17
         * @return
         */
        @GET("group/classinfo/{groupid}")
        Call<CourseListResponse> getClassGoodDetail(@Path("groupid") String groupid);

        /**
         * 分组测评表 答案提交
         * @since 2018-06-17
         * @return
         */
        @POST("group/submit")
        Call<SignUpSubmitInfoResponse> newTeamSheetSubmitInfo(@Body NewSignUpSubmitInfoRequest newSignUpSubmitInfoRequest);

        /**
         * 小组订单生成
         * @param groupid
         * @return
         */
        @FormUrlEncoded
        @POST("order/addOrderGroup")
        Call<OrderDetailResponse> createTeamOrder(@Field("groupid") String groupid);

        @POST("order/refund")
        Call<BaseResponse> refundOrder(@Body RefundOrderRequest refundOrderRequest);

        @GET("group/evaluatelist/{groupid}")
        Call<NewTeamSheetListResponse> getClassTeamEvaluateList(@Path("groupid") String groupid);

        @GET("group/evaluatetraininglist/{groupid}")
        Call<NewTeamEvaluateTrainingListResponse> getClassTeamEvaluateTrainingList(@Path("groupid") String groupid);

        @GET("group/status/{conversationid}")
        Call<BaseResponse> getGroupStatus(@Path("conversationid") String conversationid);

        /**
         * @param courseId   课程id
         * @param isdownload 是否是下载任务 y:是 n:否
         * @return
         */
        @GET("course/info/{id}")
        Call<CourseDetailResponse> getCourseDetail(@Path("id") String courseId, @Query("isdownload") String
                isdownload);

        @GET("user/messageList")
        Call<MsgListResponse> getMsgList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("user/messageRead/{messageid}")
        Call<BaseResponse> readMsg(@Path("messageid") String messageid);

        @GET("course/courseUserList")
        Call<CourseListResponse> getDownLoadList(@Query("pageNum") int pageNum, @Query("pageSize") int
                pageSize);

        @GET("course/feedbacklist/{courseid}")
        Call<CourseFeedbackListResponse> getCourseFeedbackList(@Path("courseid") String courseId, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("schoollive/courseAndTaskDateIdentifyList")
        Call<DateHasDataResponse> getCourseDateHasDataList(@Query("plandatetimestr") String datestr);

        /**
         * 查询小组课程日期接口
         * @param datestr
         * @param groupid 小组id
         * @return
         */
        @GET("group/coursedateidentifylist")
        Call<DateHasDataResponse> getTeamDateHasDataList(@Query("plandatetimestr") String datestr, @Query("groupid") String groupid);

        @POST("course/feedbackUpdate")
        Call<BaseResponse> updateCourseFeedback(@Body CourseFeedbackEditRequest courseFeedbackEditRequest);

        @GET("task/taskDateIdentifyList")
        Call<DateHasDataResponse> getHomeworkDateHasDataList(@Query("datestr") String datestr);

        @FormUrlEncoded
        @POST("user/feedbackAdd")
        Call<BaseResponse> sendSuggestion(@Field("content") String content);

        @FormUrlEncoded
        @POST("home/articleSuggestionAdd")
        Call<BaseResponse> addHomelandSuggestion(@Field("content") String content, @Field("articleid")
                String articleid);

        @FormUrlEncoded
        @POST("user/checkVersion")
        Call<CheckVersionResponse> checkVersion(@Field("versionnum") String versionnum);

        @POST("course/feedbackAdd")
        Call<BaseResponse> addCourseFeedBack(@Body AddCourseFeedBackRequest addCourseFeedBackRequest);

        @GET("course/courseRelCancel/{relid}")
        Call<BaseResponse> delCourseDownload(@Path("relid") String relid);

        @GET("report/feedbackAdd/{reportid}")
        Call<BaseResponse> addReport(@Path("reportid") String reportid, @Query("content") String content);

        @GET("report/feedbackUpdate/{id}")
        Call<BaseResponse> updateReport(@Path("id") String reportid, @Query("content") String content);

        @GET("course/summary")
        Call<GetSummaryResponse> getSummary(@Query("plandatetimestr") String plandatetimestr);

        @POST("task/update")
        Call<BaseResponse> commitHomeWork(@Body CommitHomeWorkRequest commitHomeWorkRequest);

        @GET("report/list")
        Call<ReportBriefListResponse> getReportList(@Query("pageNum") int pageNum, @Query("pageSize") int
                pageSize);

        @GET("report/feedbacklist/{reportid}")
        Call<ReportFeedbackListResponse> getReportFeedbackList(@Path("reportid") String reportid, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);

        /**
         * @param id 报告ID
         * @return
         */
        @GET("report/info/{id}")
        Call<ReportDetailResponse> getReportDetail(@Path("id") String id);

        /**
         * @param id NoticeID
         * @return
         */
        @GET("notice/info/{id}")
        Call<NoticeDetailResponse> getNoticeDetail(@Path("id") String id);


        @GET("evaluate/listfull")
        Call<ReportResultResponse> getEvaluateList(@Query("pageNum") int pageNum, @Query("pageSize") int
                pageSize);

        @GET("evaluate/evaluteProjectList/{evaluateid}")
        Call<GetReportResultResponse> getEvaluateanalysisResult(@Path("evaluateid") String evaluateid);

        @GET("iep/queryIepPlanList/{evaluateid}")
        Call<GetIepPlanTableResponse> getEvaluatePlanList(@Path("evaluateid") String evaluateid);

        @GET("iep/queryIepTempList/{ieptempid}")
        Call<IepTempListResponse> getIepTempList(@Path("ieptempid") String ieptempid, @Query("pageNum") int
                pageNum, @Query("pageSize") int pageSize);

        @GET("training/targetinfo")
////training/targetinfo?tempid=e548cebc5df01b51015df022e2ae00ef&trainingid=4028b881607bc08301607be0f7df002d&pageNum=1&pageSize=10
        Call<PlanDetailCallListViewResponse> getPlanDetailCallList(@Query("tempid") String tempid, @Query("trainingid") String trainingid, @Query("pageNum") int
                pageNum, @Query("pageSize") int pageSize);

        @GET("training/list")
        Call<TrainingListResponse> getTrainingList(@Query("pageNum") int pageNum, @Query("pageSize") int
                pageSize);

        @GET("group/traininglist/{groupid}")
        Call<TrainingListResponse> getClassRoomTrainingList(@Path("groupid") String groupid, @Query("pageNum") int pageNum);

        @GET("training/info/{id}")
        Call<PlanDetailResponse> getTrainingInfo(@Path("id") String id);

        @GET("training/feedbackList/{trainingid}")
        Call<ReportPlanFeedbackListResponse> getTrainingFeedbackList(@Path("trainingid") String trainingid,
                                                                     @Query("pageNum") int pageNum, @Query
                                                                             ("pageSize") int pageSize);

        /**
         * 套餐
         *
         * @param pageNum 进行中:nexpire 已结束:expire
         */
        @GET("order/userProductList")
        Call<UserProductListResponse> getUserProductList(@Query("status") String status, @Query("pageNum")
                int pageNum, @Query("pageSize") int pageSize);

        /**
         * 产品详情
         */
        @GET("product/info/{id}")
        Call<ProductDetailResponse> getProductDetail(@Path("id") String id);

        /**
         * 订单列表
         */
        @GET("product/list")
        Call<ProductListResponse> getProductList(@Query("typeid") String typeid, @Query("pageNum") int
                pageNum, @Query("pageSize") int pageSize);

        @GET("product/typeList")
        Call<GetProductTypeResponse> getProductTypeList();

        @FormUrlEncoded
        @POST("order/addOrderSubject")
        Call<OrderDetailResponse> createOrder(@Field("subjectid") String subjectid);

        @POST("user/updateStudentInfoFull")
        Call<UserResponse> updateStudentInfo(@Body UpdateStudentInfoRequest updateStudentInfoRequest);

        @POST("order/cancel/{id}")
        Call<BaseResponse> cancelOrder(@Path("id") String id);

        @POST("order/del/{id}")
        Call<BaseResponse> delOrder(@Path("id") String id);

        @POST("order/payorderInfo/{id}")
        Call<GetPayInfoResponse> getPayOrderInfo(@Path("id") String id, @Query("type") String type);

        @POST("order/payorderInfo/{id}")
        Call<GetWxPayInfoResponse> getWxPayOrderInfo(@Path("id") String id, @Query("type") String type);

        /**
         * 订单列表
         *
         * @param status 状态 全部:传空 待付款:init 已付款:pass
         */
        @GET("order/list")
        Call<GetOrderListResponse> getOrderList(@Query("status") String status, @Query("pageNum") int
                pageNum, @Query("pageSize") int pageSize);

        /**
         * @param status   状态 待确认:init 已消费:pass
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("order/orderProductConsumeRecordList")
        Call<ExpenseRecordListResponse> getConsumeRecordList(@Query("status") String status, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("order/orderProductConsume/{id}")
        Call<BaseResponse> orderProductConsume(@Path("id") String id);

        @GET("order/orderProductConsumeRecordNum")
        Call<ExpenseRecordCountResponse> orderProductConsumeRecordNum();

        @GET("org/user/{id}")
        Call<TeacherDetailResponse> getOrgTeacherInfo(@Path("id") String id);

        @GET("depart/list")
        Call<OrganizationListResponse> getOrganizationList(@Query("status") String status, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("depart/changedepartfull")
        Call<BaseResponse> changeOrganization(@Query("departid") String departid, @Query("studentid") String studentid);

        /**
         * @param activitytype activitytype 弹窗:pop
         * @param pageNum
         * @param pageSize
         * @return
         */
        @GET("activity/list")
        Call<MainActivityListResponse> getActivityList(@Query("activitytype") String activitytype, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);

        /*
         *分析结果文件列表
         */
        @GET("evaluate/evaluateAnalysislist/{evaluateid}")
        Call<GetEvaluateAnalysisListResponse> getEvaluateAnalysislist(@Path("evaluateid") String evaluateid);

        @FormUrlEncoded
        @POST("user/uploadStudentFile")
        Call<MediaobjectBeanResponse> uploadStudentFile(@Field("filetype") String filetype, @Field("type") String type, @Field("cover") String cover,
                                                        @Field("url") String url, @Field("name") String name);

        @GET("custom/planlist")
        Call<CustomPlanlistResponse> getPlanList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("custom/doclist/{customplanid}")
        Call<CustomPlanDocListResponse> getCustomPlanDocList(@Path("customplanid") String customplanid, @Query
                ("pageNum") int pageNum, @Query("pageSize") int pageSize);


        @GET("custom/msgList/{customplanid}")
        Call<CustomMsglistResponse> getCustomplanMsgList(@Path("customplanid") String customplanid, @Query("type") String type, @Query
                ("msgid") String msgid, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        /**
         * @param degree 满意度 1:满意 2:一般 3:不满意
         */
        @FormUrlEncoded
        @POST("custom/eval/{customplanid}")
        Call<BaseResponse> postCustomplanEval(@Path("customplanid") String customplanid, @Field("degree") String degree, @Field("commentid") String commentid);

        @POST("custom/customplanCreate")
        Call<CreateCustomPlanResponse> createCustomplan();

        @POST("custom/docUpdate")
        Call<BaseResponse> postDocUpdate(@Body CustomPlanFileUploadRequest courseFeedbackEditRequest);

        /**
         * @param content      内容
         * @param customplanid 咨询计划id
         * @param type         类型 1:图片 2:视频 3:音频 4:文字 5:套餐 6:评价
         * @param cover        视频封面
         * @param url          链接 套餐消息:套餐url
         * @param timelen      时长
         *                     //         * @param extendfield1 扩展字段1 套餐消息:套餐id 评价消息:-1:未操作 1:满意 2:一般 3:不满意
         *                     //         * @param extendfield2 扩展字段2 套餐消息:套餐标题
         *                     //         * @param extendfield3 扩展字段3 套餐消息:套餐原价
         *                     //         * @param extendfield4 扩展字段4 套餐消息:套餐折扣价
         *                     //         * @param extendfield5 扩展字段5 套餐消息:售出数量
         *                     //         * @param extendfield6 扩展字段6 套餐消息:库存
         * @return
         */
        @FormUrlEncoded
        @POST("custom/msgAdd")
        Call<BaseResponse> addMsg(@Field("content") String content, @Field("customplanid") String customplanid,
                                  @Field("type") String type, @Field("cover") String cover, @Field("url") String url,
                                  @Field("timelen") String timelen);

//        @GET("custom/msgList/{customplanid}")
//        Call<BaseResponse> getCustomplanMsgList(@Field("customplanid") String customplanid, @Query
//                ("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("type") String type){
//
//        }

        /**
         * @since v1.0.3
         * 新版通用发消息接口
         *
         * targettype: 单聊中使用 1:家长 2:老师 群聊为空#####
         * target: 单聊:userid 群聊:imgroupid(@开头的)#####
         * type: 1:图片 2:视频 3:音频 4:文字 5:套餐 6:评价 7:公开课#####
         * timelen: 音频时长 #####
         * extendfield1: 套餐消息:套餐id 评价消息:-1:未操作 1:满意 2:一般 3:不满意 公开课消息:公开课id#####
         * extendfield2: 套餐消息:套餐标题 公开课消息:公开课标题#####
         * extendfield3: 套餐消息:套餐原价 公开课消息:公开课原价#####
         * extendfield4: 套餐消息:套餐折扣价 公开课消息:公开课折扣价#####
         * extendfield5: 套餐消息:售出数量 公开课消息:公开课售出数量#####
         * extendfield6: 套餐消息:库存
         * @param addImMsgRequest
         * @return
         */
        @POST("immessage/add")
        Call<ChatMessageResponse> addImMsg(@Body AddImMsgRequest addImMsgRequest);

        @GET("immessage/msgList/{conversationid}")
        Call<CustomMsglistResponse> getCommonMsgList(@Path("conversationid") String conversationid, @Query("msgid") String msgid, @Query("pageNum") String pageNum);

        @FormUrlEncoded
        @POST("user/delStudentFile")
        Call<BaseResponse> delStudentFile(@Field("filetype") String filetype, @Field("id") String id);

        @GET("custom/docNum/{customplanid}")
        Call<StringResponse> getDocNum(@Path("customplanid") String customplanid);

        @POST("message/batchdel")
        Call<BaseResponse> batDelMsg(@Body MsgDeleteBatRequest msgDeleteBatRequest);

        //报名
        @GET("enroll/enrollinglist")
        Call<SignUpListResponse> getSignList(@Query("pageNum") String pageNum, @Query("pageSize") String pageSize);

        /**
         * enroll：报名 continue:继续报名
         * @param departcode
         * @return
         */
        @GET("enroll/notice")
        Call<SignUpNoticeResponse> getSignNotice(@Query("departcode") String departcode, @Query("type") String type, @Query("web") String web);

        @GET("enroll/evaluatelist")
        Call<SignUpEvaluateResponse> getSignEvaluate(@Query("pageNum") String pageNum, @Query("pageSize") String pageSize, @Query("departid") String departid);

        @POST("enroll/infosubmit")
//enroll/infosubmit
        Call<SignUpSubmitInfoResponse> signUpSubmitInfo(@Query("departid") String departid, @Body SignUpSubmitInfoRequest signUpSubmitInfoRequest);

        @GET("enroll/info/{enrollstudnetid}")
        Call<SignUpDetailResponse> signUpDetailInfo(@Path("enrollstudnetid") String enrollstudnetid);

        @GET("enroll/evaluateresultlist")
        Call<SignUpDetailEvaluateBean> signUpDetailEvaluate(@Query("pageNum") String pageNum, @Query("pageSize") String pageSize, @Query("departid") String departid, @Query("enrollstudnetid") String enrollstudnetid);

        @GET("enroll/judgestatus/{enrollstudnetid}")
        Call<GiveUpInformResponse> signUpIsGiveUpInform(@Path("enrollstudnetid") String enrollstudnetid);

        @GET("enroll/entrancenotice/{enrollstudnetid}")
        Call<SignUpInformResponse> signUpInform(@Path("enrollstudnetid") String enrollstudnetid);

        @POST("enroll/abandoncauseadd")
        Call<BaseResponse> signUpGiveupReason(@Query("enrollstudnetid") String enrollstudnetid);

        @POST("enroll/infoupdate")
        Call<BaseResponse> signUpFixStudentInfo(@Body SignUpFixStudentInfoBean upFixStudentInfoBean);

        @POST("enroll/contactupdate")
        Call<BaseResponse> signUpFixparentInfo(@Body SignUpFixParentInfoBean upFixParentInfoBean);

        @GET("user/captcha/{phone}")
        Call<BaseResponse> getCaptche(@Path("phone") String phone);

        @POST("user/updatecount")
        Call<BaseResponse> submitCaptcheInfo(@Query("phone") String phone, @Query("captchacode") String captcheCode);

        @POST("user/updateemail")
        Call<BaseResponse> signUpEmail(@Query("email") String email);

        @POST("user/updatePassword")
        Call<BaseResponse> newPassword(@Query("oldpassword") String oldpassword, @Query("password") String password);

        @POST("user/unbind/{openid}")
        Call<ThirdUnboundResponse> unboundThird(@Path("openid") String openid);

        @GET("report/statistic/{reportid}")
        Call<ReportFromsTypeResponse> getReportType(@Path("reportid") String reportid);

        @GET("report/targetAndCourseList/{reportid}")
        Call<RepoetFromsLineListResponse> getReportLineData(@Path("reportid") String reportid);

        @GET("report/resultAndDate")
        Call<ReportFromsLineCourseResponse> getReportLineCourse(@Query("reportid") String reportid, @Query("courseid") String courseid);

        @GET("schoollive/listall")
        Call<SchoolliveAllResponse> getSchoolLive(@Query("plandatetimestr") String plandatetimestr);

        @GET("subject/list")
        Call<SubjectListResponse> getSubjectList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("pricemax") String pricemax, @Query("pricemin") String pricemin,
                                              @Query("commentnum") String commentnum, @Query("sellcount") String sellcount, @Query("datetimestr") String datetimestr, @Query("best") String best, @Query("key") String key);

        @GET("subject/usersubjectlist")
        Call<SubjectListResponse> getMySubjectList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @GET("subject/info/{id}")
        Call<ProductDetailInfoResponse> getProductDetailInfo(@Path("id") String id);

        @GET("subject/catalog/{id}")
        Call<ProductatalogListResponse> getProductCatalogList(@Path("id") String id);

        @GET("subject/commentlist/{id}")
        Call<ProductCommentListResponse> getProductCommentList(@Path("id") String id, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

        @POST("subject/addcomment/{id}")
        Call<BaseResponse> addSubjectComment(@Path("id") String id, @Body SubjectCommentRequestBody subjectCommentRequestBody);

        @GET("subject/cataloginfo/{subjectcourseid}")
        Call<GetSubjectResponse> getSubjectCatalogInfo(@Path("subjectcourseid") String subjectcourseid);

        @GET("user/uploadTokenSimple")
        Call<BaseResponse> getUploadToken();

        @GET("user/uploadToken")
        Call<BaseResponse> getUploadTokenByPath(@Query("filepath") String filepath);

        @GET("live/recordeventlist/{id}")
        Call<ZhiboRecordResponse> getRecordEventList(@Path("id") String id, @Query("timelenstamp") String timelenstamp);

        @POST("gallery/mediaurl")
        Call<StringResponse> upGradeMediaUrl(@Body UploadUrlRequest uploadUrlRequest);

        @POST("user/bindThirdParty/{code}")
        Call<ThirdBeanResponse> bindThirdParty(@Path("code") String code, @Query("type") String type);

        @FormUrlEncoded
        @POST("live/meetingapply")
        Call<BaseResponse> sendRtcApply(@Field("id") String liveid);

        @FormUrlEncoded
        @POST("live/meetingapplycancel")
        Call<BaseResponse> sendRtcApplyCancel(@Field("id") String liveid);

        @POST("live/event")
        Call<BaseResponse> sendZhiboEvent(@Body ZhiboAddImMsgRequest resuest);

        @FormUrlEncoded
        @POST("live/userenter")
        Call<ZhiboRoomResponse> enterZhiboRoom(@Field("id") String id);

        @FormUrlEncoded
        @POST("live/userleave")
        Call<BaseResponse> leaveZhiboRoom(@Field("id") String id);

        @POST("live/sendmsg")
        Call<BaseResponse> sendMsg(@Body ZhiboStrMsgRequest resuest);

        @FormUrlEncoded
        @POST("live/meetinginviteconfim")
        Call<BaseResponse> sendMeetingInviteConfirm(@Field("id") String id, @Field("invitekey") String invitekey);

        @FormUrlEncoded
        @POST("live/meetinginvitecancel")
        Call<BaseResponse> sendMeetingInviteCancel(@Field("id") String id, @Field("invitekey") String invitekey);

        @FormUrlEncoded
        @POST("live/meetingstop")
        Call<BaseResponse> stopConference(@Field("id") String id, @Field("channel") String channel);

        /**
         * 小组
         */
        @GET("group/list")
        Call<TeamListResponse> getTeamList(@Query("pageNum") int pageNum, @Query("type") String type);

        /**
         *进入小组直播
         * @param groupid 群组id
         * @return
         */
        @FormUrlEncoded
        @POST("group/liveenter")
        Call<BaseResponse> enterTeamLive(@Field("groupid") String groupid);

        /**
         * 小组成员列表
         * @param groupid 群组id
         * @param pageNum
         * @return
         */
        @GET("group/memberlist/{groupid}")
        Call<TeamUserlistResponse> getTeamMemberList(@Path("groupid") String groupid, @Query("pageNum") int pageNum);

        /**
         * 小组公告列表
         * @param groupid 群组id
         * @param pageNum
         * @return
         */
        @GET("group/noticelist/{groupid}")
        Call<AnnouncementListResponse> getTeamNoticeList(@Path("groupid") String groupid, @Query("pageNum") int pageNum);

        @POST("immessage/conversationinfo")
        Call<StringResponse> createSingleConversation(@Body CreateSingleConversionRequest createSingleConversionRequest);

        @GET("group/liverecordlist/{groupid}")
        Call<GetSingleLiveVideoRecordListResponse> getLiveRecordList(@Path("groupid") String groupid, @Query("pageNum") int pageNum);

        /**
         * 当天所有小组课程列表
         * @param plandatetimestr
         * @param pageNum
         * @return
         */
        @GET("group/usercourselist")
        Call<CourseListResponse> getUserCourseList(@Query("plandatetimestr") String plandatetimestr, @Query
                ("pageNum") int pageNum);

        @FormUrlEncoded
        @POST("group/liveenter")
        Call<ZhiboRoomResponse> enterTeamZhiboRoom(@Field("groupid") String groupid);

        @GET("order/refundinfo/{id}")
        Call<GetRefundInfoResponse> getRefundInfo(@Path("id") String id);

    }

}

class MFPRequestInterceptor implements Interceptor {

    String token;

    String user_agent;

    public MFPRequestInterceptor(String token, String user_agent) {
        this.token = token;
        this.user_agent = user_agent;
    }

    @Override
    public Response intercept(Interceptor.Chain chain) throws IOException {
        Request original = chain.request();
        Request.Builder requestBuilder = original.newBuilder();
        if (!TextUtils.isEmpty(token)) {
            requestBuilder.addHeader("token", token);
        }
        if (!TextUtils.isEmpty(user_agent)) {
            requestBuilder.addHeader("molyfun_user_agent", user_agent);
        }
        Request request = requestBuilder.build();
        return chain.proceed(request);
    }
}


